package com.ruoyi.production.service.impl.pesticide;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.pesticide.PesticideApplyTemporary;
import com.ruoyi.production.mapper.pesticide.PesticideApplyTemporaryMapper;
import com.ruoyi.production.service.pesticide.IPesticideApplyTemporaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 农药临时申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-11
 */
@Service
public class PesticideApplyTemporaryServiceImpl implements IPesticideApplyTemporaryService
{
    @Autowired
    private PesticideApplyTemporaryMapper pesticideApplyTemporaryMapper;

    /**
     * 查询农药临时申请
     *
     * @param pesticideApplyTemporaryId 农药临时申请ID
     * @return 农药临时申请
     */
    @Override
    public PesticideApplyTemporary selectPesticideApplyTemporaryById(Long pesticideApplyTemporaryId)
    {
        return pesticideApplyTemporaryMapper.selectPesticideApplyTemporaryById(pesticideApplyTemporaryId);
    }

    /**
     * 查询农药临时申请列表
     *
     * @param pesticideApplyTemporary 农药临时申请
     * @return 农药临时申请
     */
    @Override
    public List<PesticideApplyTemporary> selectPesticideApplyTemporaryList(PesticideApplyTemporary pesticideApplyTemporary)
    {
        return pesticideApplyTemporaryMapper.selectPesticideApplyTemporaryList(pesticideApplyTemporary);
    }

    /**
     * 新增农药临时申请
     *
     * @param pesticideApplyTemporary 农药临时申请
     * @return 结果
     */
    @Override
    public int insertPesticideApplyTemporary(PesticideApplyTemporary pesticideApplyTemporary)
    {












        pesticideApplyTemporary.setCreateTime(DateUtils.getNowDate());



        return pesticideApplyTemporaryMapper.insertPesticideApplyTemporary(pesticideApplyTemporary);
    }

    /**
     * 修改农药临时申请
     *
     * @param pesticideApplyTemporary 农药临时申请
     * @return 结果
     */
    @Override
    public int updatePesticideApplyTemporary(PesticideApplyTemporary pesticideApplyTemporary)
    {
        pesticideApplyTemporary.setUpdateTime(DateUtils.getNowDate());
        return pesticideApplyTemporaryMapper.updatePesticideApplyTemporary(pesticideApplyTemporary);
    }

    /**
     * 批量删除农药临时申请
     *
     * @param pesticideApplyTemporaryIds 需要删除的农药临时申请ID
     * @return 结果
     */
    @Override
    public int deletePesticideApplyTemporaryByIds(Long[] pesticideApplyTemporaryIds)
    {
        return pesticideApplyTemporaryMapper.deletePesticideApplyTemporaryByIds(pesticideApplyTemporaryIds);
    }

    /**
     * 删除农药临时申请信息
     *
     * @param pesticideApplyTemporaryId 农药临时申请ID
     * @return 结果
     */
    @Override
    public int deletePesticideApplyTemporaryById(Long pesticideApplyTemporaryId)
    {
        return pesticideApplyTemporaryMapper.deletePesticideApplyTemporaryById(pesticideApplyTemporaryId);
    }
}
